﻿using System;
using System.Web.UI;
using mojoPortal.Web.RS.PRM.AppCode.Lib;

 
namespace mojoPortal.Web.RS.PRM
{
    public partial class RSEmployeeManagePermission : RSBasePage
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
        }

        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
                InitializeReadyServicePage("Manage Permission");
                RSUserIdentity userIdentity = GetRSUserIdentity();
                if (RSPRMCommonFunctions.ValidatePermission(userIdentity.RSGroupName, userIdentity.RSPIN))
                {
                    ucEmployeeListManagePermissionControl.LoadEmployeeList(userIdentity.RSCompanyId);
                    if (Request.QueryString["action"] == "add")
                        SetRSPageHeader("Add Employee");
                    else
                        SetRSPageHeader("Edit Employee");
                }
                else
                {
                    lblMessage.Text = "You Do Not Have Permission To View This Page!";
                    pnlAgent.Visible = false;
                }
            }
        }
        
    }
}